package com.hhkj.study.admin.teacher.model.podo;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.hhkj.study.admin.teacher.entity.Teacher;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.valid.VAdd;
import lombok.Data;

import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
*
* @author SERVER
* @since 2024-09-06
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class TeacherDo extends Teacher {

    /**
     * 授课范围
     */
    @NotEmpty(message = "授课范围不能为空", groups = VAdd.class)
    private List<Long> teacherScopeIdList;

    /**
     * 授课范围id
     */
    private Long teacherScopeId;

    /**
     * 标签id列表
     */
    private List<Long> tagList;

    @Override
    public String getTags() {
        if (CollectionUtil.isNotEmpty(tagList)) {
            return JSONUtil.toJsonStr(tagList);
        }
        return super.getTags();
    }
}